#!/usr/bin/env python
# vim:fileencoding=utf-8
# https://manual.calibre-ebook.com/news_recipe.html
from __future__ import absolute_import, division, print_function, unicode_literals

from calibre.web.feeds.news import BasicNewsRecipe

'''
Politiko.dk
'''


class PolitikoDK(BasicNewsRecipe):
    title                 = 'Politiko | Berlingskes politiske site'
    __author__            = 'CoderAllan.github.com'
    publisher             = 'Berlingske Media'
    description           = ('Læs de seneste nyheder om dansk politik. På Politiko får du alt om'
                             ' politik samlet et sted - Politiko.dk')
    category              = 'news, politics, money, Denmark'
    oldest_article        = 2
    max_articles_per_feed = 50
    no_stylesheets        = True
    encoding              = 'utf8'
    use_embedded_content  = False
    language              = 'da'
    auto_cleanup          = False

    keep_only_tags = [
        dict(name='h1', attrs={'class': 'article-headline'}),
        dict(name='p', attrs={'class': 'article-summary'}),
        dict(name='div', attrs={'class': 'article-date'}),
        dict(name='div', attrs={'class': 'article-content'}),
    ]

    # Feed are found here: http://www.b.dk/rss
    feeds          = [
        ('Nyheder', 'http://www.politiko.dk/feeds/rss/nyheder'),
        ('Politisk Morgenpost', 'http://www.politiko.dk/taxonomy_rss/329960/rss'),
        ('Den Politiske Puls', 'http://puls.politiko.dk/feed/'),
        ('Analyse og perspektiv', 'http://www.politiko.dk/feeds/rss/analyser'),
        ('Longreads', 'http://www.politiko.dk/feeds/rss/longreads'),
    ]
